﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary.DAO
{
    public class Code
    {
        public static int FixIntNull(object dbvalue)
        {
            if (dbvalue == null)
                return 0;
            else
                return (int)dbvalue;
        }

        public static string FixStringNull(object dbvalue)
        {
            if (dbvalue == null)
                return "";
            else
                return (string)dbvalue;
        }

        public static double FixDoubleNull(object dbvalue)
        {
            if (dbvalue == null)
                return 0;
            else
                return (double)dbvalue;
        }

        public static float FixFloatNull(object dbvalue)
        {
            if (dbvalue == null)
                return 0;
            else
                return (float)dbvalue;
        }
    }
}
